The present invention relates to a logic circuit which is capable of changing from outside a memory which comprises a flip-flop and an electrically writable memory element or an electrically erasable memory element. In particular, the present invention relates to a semiconductor logical device which is generally referred to as a field programmable gate array (i.e. FPGA).